﻿<UserControl x:Class="ScrumFactory.Windows.Options"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:props="clr-namespace:ScrumFactory.Windows.Properties"
             xmlns:SF_Helpers="clr-namespace:ScrumFactory.Windows.Helpers;assembly=ScrumFactory.Windows.Helpers"
             xmlns:SF_Comp="clr-namespace:ScrumFactory.Composition;assembly=ScrumFactory.Composition" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    
    <UserControl.Resources>

        <Style x:Key="restartLabelStye" TargetType="TextBlock">
            <Setter Property="Text" Value="{x:Static props:Resources.Requires_restart}"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>

    </UserControl.Resources>
    
    <TabControl Style="{StaticResource WindowTabControl}">
        <TabControl.Items>
            <TabItem Header="{x:Static props:Resources.Options_}">
                <SF_Helpers:PanelLayout 
                    ShowCurrentProjectName="False"
                    Title="{x:Static props:Resources.Options_}" Style="{StaticResource DetailPanelLayout}">

                    <!-- TOOLBAR -->
                    <!--<SF_Helpers:PanelLayout.Toolbar>
                        <ToolBar>
                            <MenuItem Style="{StaticResource GoBackMenuItem}"/>                            
                        </ToolBar>
                    </SF_Helpers:PanelLayout.Toolbar>-->

                    <!-- CONTENT -->
                    <SF_Helpers:PanelLayout.Content> 
                        
                        <TabControl>
                            <TabItem Header="{x:Static props:Resources.General_options}">
                                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                                    <StackPanel Margin="0,20,0,20">
                                        <TextBlock Text="{x:Static props:Resources.Language_settings}" Style="{StaticResource ItemGroupTextBlock}"/>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="200"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="auto"/>
                                                <RowDefinition Height="auto"/>
                                            </Grid.RowDefinitions>
                                            <TextBlock Grid.Column="0" Style="{StaticResource LabelTextBlock}">
                                    <TextBlock   Text="{x:Static props:Resources.Interface_language}"/><LineBreak/>
                                      <TextBlock Style="{StaticResource restartLabelStye}"/>
                                </TextBlock>

                                            <ComboBox Grid.Column="1"
                                          HorizontalAlignment="Left" MinWidth="200"
                                          SelectedItem="{Binding SelectedLanguage}"
                                          ItemsSource="{Binding Languages}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                                            <Image Source="{Binding ImagePath}" Margin="0,0,4,0" Height="20"/>
                                                            <TextBlock Text="{Binding Description, Converter={StaticResource LocalizeConverter}}" VerticalAlignment="Center"/>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock  Grid.Row="1" Grid.Column="0" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.Spell_checker}"/>
                                            <StackPanel Grid.Row="1" Grid.Column="1">
                                                <ComboBox 
                                          HorizontalAlignment="Left" MinWidth="200"
                                          SelectedItem="{Binding SpellCheckLanguage}"
                                          ItemsSource="{Binding SpellCheckLanguages}">
                                                    <ComboBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <TextBlock Text="{Binding Description}" />
                                                        </DataTemplate>
                                                    </ComboBox.ItemTemplate>
                                                </ComboBox>
                                                <TextBlock Text="{x:Static props:Resources.Spell_checker_tooltip}" FontSize="{StaticResource SmallFontSize}"/>
                                            </StackPanel>

                                        </Grid>

                                        <TextBlock Text="{x:Static props:Resources.Projects}" Style="{StaticResource ItemGroupTextBlock}" Margin="0,20,0,0"/>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="200"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <CheckBox IsChecked="{Binding UsePoints}" Content="{x:Static props:Resources.Show_points_at_backlog_list}" Grid.Column="1"/>
                                        </Grid>
                                        
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="200"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="auto"/>
                                                <RowDefinition Height="auto"/>
                                            </Grid.RowDefinitions>
                                            <TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.Sprint_length}"/>
                                            <TextBox Grid.Column="1"  Grid.Row="0"  Text="{Binding SprintLength}" Width="40" MinWidth="40" HorizontalContentAlignment="Right" MaxLength="2"/>
                                            <TextBlock Grid.Column="0"  Grid.Row="1" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.ProjectFolderFilePath}"/>
                                            <StackPanel Grid.Column="1" Grid.Row="1">
                                                <TextBox Text="{Binding ProjectFolderFilePath}" HorizontalAlignment="Stretch"/>
                                                <TextBlock Text="{x:Static props:Resources.ProjectFolderFilePath_tooltip}" Style="{StaticResource LabelTextBlock}" FontSize="{StaticResource SmallFontSize}" Margin="3,-6,0,0"/>
                                            </StackPanel>
                                        </Grid>






                                        <TextBlock Text="{x:Static props:Resources.Ticket_projects_settings}" Style="{StaticResource ItemGroupTextBlock}" Margin="0,20,0,0"/>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="200"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Grid.Column="1">
                                                <CheckBox IsChecked="{Binding TicketProjectsEnabled}" Content="{x:Static props:Resources.Enable_ticket_projects}" />
                                                <TextBlock Text="{x:Static props:Resources.Ticket_project_alert}" FontSize="{StaticResource SmallFontSize}" />
                                            </StackPanel>
                                            
                                        </Grid>





                                    </StackPanel>
                                </ScrollViewer>
                            </TabItem>
                            <TabItem Header="{x:Static props:Resources.SVN_options}">

                                <StackPanel Margin="0,20,0,20">
                                    <TextBlock Style="{StaticResource ItemGroupTextBlock}" Text="{x:Static props:Resources.SVN_settings}" />
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="200"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="auto"/>
                                            <RowDefinition Height="auto"/>
                                            <RowDefinition Height="auto"/>
                                            <RowDefinition Height="auto"/>
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.SVN_command}"/>
                                        <StackPanel Grid.Column="1" Grid.Row="0">
                                            <TextBox Text="{Binding SVNCommand}" HorizontalAlignment="Stretch"/>
                                            <TextBlock Text="{x:Static props:Resources.SVN_tooltip}"  FontSize="{StaticResource SmallFontSize}" Margin="3,-6,0,0"/>
                                        </StackPanel>
                                        <TextBlock Grid.Column="0" Grid.Row="1" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.RepositoryUrl}"/>
                                        <StackPanel Grid.Column="1" Grid.Row="1">
                                            <TextBox Text="{Binding RepositoryUrl}" HorizontalAlignment="Stretch"/>
                                            <TextBlock Text="{x:Static props:Resources.RepositoryUrl_tooltip}"  FontSize="{StaticResource SmallFontSize}" Margin="3,-6,0,0"/>
                                        </StackPanel>
                                        <TextBlock Grid.Column="0" Grid.Row="2" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.RepositoryPath}"/>
                                        <StackPanel Grid.Column="1" Grid.Row="2">
                                            <TextBox Text="{Binding RepositoryFilePath}" HorizontalAlignment="Stretch"/>
                                            <TextBlock Text="{x:Static props:Resources.RepositoryPath_tooltip}" FontSize="{StaticResource SmallFontSize}" Margin="3,-6,0,0"/>
                                        </StackPanel>
                                        <TextBlock Grid.Column="0" Grid.Row="3" Style="{StaticResource LabelTextBlock}" Text="{x:Static props:Resources.RepositoryVersion}"/>
                                        <StackPanel Grid.Column="1" Grid.Row="3">
                                            <ComboBox SelectedValue="{Binding RepositoryVersion}" SelectedValuePath="Tag" HorizontalAlignment="Left" MinWidth="150">
                                                <ComboBox.Items>
                                                    <ComboBoxItem Tag="" Content=""/>
                                                    <ComboBoxItem Tag="1" Content="Subversion 10"/>
                                                    <ComboBoxItem Tag="2" Content="Subversion 14"/>
                                                    <ComboBoxItem Tag="3" Content="Subversion 15"/>
                                                    <ComboBoxItem Tag="4" Content="Subversion 16"/>
                                                    <ComboBoxItem Tag="5" Content="Subversion 17"/>
                                                    <ComboBoxItem Tag="6" Content="Subversion 18"/>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock Text="{x:Static props:Resources.RepositoryVersion_tooltip}" FontSize="{StaticResource SmallFontSize}" Margin="3,-6,0,0"/>
                                        </StackPanel>


                                    </Grid>
                                </StackPanel>
                            </TabItem>
                        </TabControl>
                        
                     
                        
                    </SF_Helpers:PanelLayout.Content>
                </SF_Helpers:PanelLayout>
            </TabItem>
           
        </TabControl.Items>
    </TabControl>

</UserControl>
